/*!
 * @Author: luoob
 * @Date: 2021-07-08 15:20:15
 * @Last Modified by: luoob
 * @Last Modified time: 2021-07-08 15:20:18
 * @Instruduction: 检验工具库
 */

/**
 * 校验网址
 * @date 2021-03-29
 * @param {string} url
 * @returns {any}
 */
export const isValidURL = (url: string) => {
    const reg = /^https?:\/\/([a-zA-Z0-9]+\.)+[a-zA-Z0-9]+/
    return reg.test(url)
}

/**
 * 验证手机号码
 * @param {String} content 待校验的字符串
 * @return {boolean} 是否正确
 */
export const isValidPhone = (str: string) => {
    const reg = /^1(3([0-35-9]\d|4[1-8])|4[14-9]\d|5([0-35689]\d|7[1-79])|66\d|7[2-35-8]\d|8\d{2}|9[13589]\d)\d{7}$/
    return reg.test(str)
}
